package com.shi.vueblog.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;

@Configuration
public class FileConfig extends WebMvcConfigurationSupport {
    @Configuration

    public class WebMvcConfig extends WebMvcConfigurationSupport {

        @Override

        public void addResourceHandlers(ResourceHandlerRegistry registry) {

            String path = "E:\\upload\\img\\";//"/tools/images/";//"E:/视频制作/图片/";
            // 上传路径映射 会使spring boot的自动配置失效
            registry.addResourceHandler("/file/**").addResourceLocations("file:" + path);
            super.addResourceHandlers(registry);

        }

    }

}
